package com.uep.controller;

import com.uep.entity.QuestionAnswer;
import com.uep.entity.QuestionAnswerKey;
import com.uep.service.QuestionAnswerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Created by XQ on 2017/2/23.
 */
@RestController
public class QuestionAnswerController {
    @Autowired
    QuestionAnswerService questionAnswerService;

    @ResponseBody
    @RequestMapping(value = "review/questionContent/{questionContent}",method = RequestMethod.GET)
    public List<QuestionAnswerKey> getReview(@PathVariable String questionContent){
        return questionAnswerService.findReview(questionContent);
    }

    @RequestMapping(value = "/reviewContent",method = RequestMethod.POST)
    public void insertReview(@RequestBody QuestionAnswer questionAnswer){
        questionAnswerService.insertOneReview(questionAnswer);
    }
}
